package com.dotflat.satistics.repository.crm;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * *********************
 * Created by Ron
 * from com.matt
 * on 2018/8/28 0028.
 * *********************
 */
public interface ClienteleRepository {


    Long findByTypeSignAndChannelAndStatus(Date begin, Date end, String areaId, String channelId,int status);

    Long findByTypeAndSignAndStatus(Date begin, Date end, String areaId,int status);

    Long findByCancelClientele(Date begin, Date end, String id, int contractStatusStop);

    Double findBreakDownByTypeAndStatus(Date begin, Date end,  String areaId, int status);

    Long findByTypeSignAndChannelAndStatusAndIsrewal(Date begin, Date end, String id, String channelId, int contractStatusStop, int contractNonRenewal);

    Long findByTypeAndSignAndStatusAndIsrewal(Date begin, Date end, String id, int contractStatusStop, int contractNonRenewal);

    Double findByCloseTime(Date begin, Date end,String areaId);

    Long findWillingRenewalCountByStatusAndContractTypeAndAreaId(int status, int type, String areaId);

    Long findRenewalCountByStatusAndContractTypeAndAndRenewalAndAreaId(int contractStatusNormal, int nurseryType,int isRenewal, String areaId);

    Long findRenewalCountByStatusAndContractTypeAndAndRenewalAndStaffId(int contractStatusNormal, int nurseryType, int contractIsRenewal, String staffId,String clienteleIds);

    Long findWillingRenewalCountByStatusAndContractTypeAndStaffId(int contractStatusNormal, int nurseryType, String staffId,String clienteleIds);

    Long findWillingRenawalEarlyCountByStatusAndTypeAndRenewalAndAreaId(int contractStatusNormal, int nurseryType, String areaId);

    Long findEarlyRenewalCountByStatusAndContractTypeAndRenewalAndAreaId(int status, int type, int isRenewal, String areaId);

    List<Map<String,Object>> findByStaffId(String staffId,String date);

    List<Map<String,Object>> findAreaCount(String date,int count);
    List<Map<String,Object>> findStaffCount(String date,int count);

    Long findAreaClienteleCountByType(String areaId,int type);
    Long findStaffClienteleCountByType(String staffId,int type);

    Long findAreaClienteleCheckInCountByType(String areaId,int classesCategory);
    Long findStaffClienteleCheckInCountByType(String staffId,int classesCategory);
}
